﻿@using PNProject
@{
    string textLang = ViewData["lang"].ToString();
}
<div class="boxleft-1">
    <div class="ttboxleft">
        <p>@this.LocalResources("RegisterEmail")</p>
    </div>
    <div class="ccboxleft">
        <div class="nhanmail">
            <p>@this.LocalResources("RegisterToReceive")</p>
            <div class="khungmail">

                <input id="kmail" type="text" name="search" placeholder="@this.LocalResources("YourEmail")" />
                <input id="nmail" type="submit" value="@this.LocalResources("Subscribe")" />

            </div>
        </div>
    </div>
</div>
<input id="hlang" type="hidden" value="@textLang" />
   <script type="text/javascript">
    $(document).ready(function () {
    
        $("#nmail").click(function () {
            var lang = $("#hlang").val();
            var tail = lang == "" ? "vi-VN" : "";
            var url = "/api/publicAPI/RegisterEmail?email=" + $("#kmail").val() + "&l=" + tail;
            $.ajax({
                url: url
            }).done(function (data) {
                alert(data);
            });

        });
    });


</script>
